def lius():
    global r,x,y,o,g,t,h,t,m,cuowu,cuo
    import time,random
    r = 0
    x = 0
    y = 0
    o = 0
    g = 6   #告诉程序一共听写几次
    m = 0
    t = {}
    h = {}
    t = {}
    cuowu = {}
    yi = {'science':'科学','museum':'博物馆','post office':'邮局','bookstore':'书店','cinema':'电影院','hospital':'医院','crossing':'十字路口','turn':'转弯','left':'左','straight':'笔直地','right':'右','ask':'问','sir':'先生','interesting':'有趣的','Italian':'意大利的','restaurant':'餐馆','pizza':'比萨饼','street':'大街;街道','get':'到达','BDS':'全球定位系统','gave':'提供;交给','feature':'特点','follow':'跟着','far':'较远的','tell':'告诉'}
    er = {'on foot':'步行','by':'（表示方式）乘','bus':'公共汽车','plane':'飞机','taxi':'出租汽车','ship':'（大）船','subway':'地铁','train':'火车','slow':'慢的','down':'减少；降低','slow down':'慢下来','stop':'停下','Mrs':'夫人','early':'早到的','helmet':'头盔','must':'必须','wear':'戴','attention':'注意','pay attention to':'注意（加pay）','traffic':'交通','traffic lights':'交通信号灯','Munich':'慕尼黑（德国城市）','Germany':'德国','Alaska':'阿拉斯加州（美国州名）','sled':'雪橇','fast':'快的','ferry':'轮渡','Papa Westray':'帕帕韦斯特雷岛','Scotland':'苏格兰'}
    san = {'visit':'拜访','film':'电影','see a film':'看电影','trip':'旅行','take a trip':'去旅行','supermarket':'超市','evening':'晚上；傍晚','tonight':'在今晚','tomorrow':'明天','next week':'下周','dictionary':'词典','comic':'滑稽的','comic book':'（儿童的）连环画册','word':'单词','word book':'单词书','postcard':'明信片','lesson':'课','space':'太空','travel':'（尤指长途）旅行','half':'一半','price':'价格','Mid-Autumn Festival':'中秋节','together':'一起','get together':'聚会','mooncake':'月饼','poem':'诗','moon':'月亮'}
    si = {'studies':'（study的第三人称单数形式）学习','puzzle':'谜','hiking':'远足','pen pal':'笔友','hobby':'业余爱好','jasmine':'茉莉','idea':'想法；主意','Canberra':'堪培拉（澳大利亚首都）','amazing':'令人惊奇的','shall':'表示征求意见','goal':'射门','join':'加入','club':'俱乐部','share':'分享'}
    wu = {'factory':'工厂','worker':'工人','postman':'邮递员','businessman':'商人；企业家','police office':'警察厅','fisherman':'渔民','scientist':'科学家','pilot':'飞行员','coach':'教练','country':'国家','head teacher':'校长','sea':'大海','stay':'保持','university':'大学','gym':'体育馆','if':'如果','reporter':'记者','use':'使用','type':'打字','quickly':'迅速地','secretary':'秘书'}
    liu = {'angry':'生气的','afraid':'害怕','sad':'难过的','worried':'担心的；发愁的','happy':'高兴的','see a doctor':'看病','wear':'穿','more':'更多的','deep':'深的','breath':'呼吸','take a deep breath':'深深吸一口气'}
    e = {0:yi,1:er,2:san,3:si,4:wu,5:liu}
    def q(v):
        global r,x,y,o,g,t,h,t,m,cuowu
        dict_key_ls = list(v.keys())
        random.shuffle(dict_key_ls)
        new_dic = {}
        for key in dict_key_ls:
            new_dic[key] = v.get(key)
        v = new_dic
        for i in v:
            cuowu = v[i]
            q = input(cuowu + '：')
            w = i
            if q == w:
                print('对喽！')
                r += 1
            else:
                print('错啦错啦！')
                t[cuowu] = w
                x += 1
        print('结束！')
        print('一共对',r,'道，错',x,'道')
        if x != 0:
            print('\n不扎实',x,'道！巩固错题：')
            for i in t:
                q = input(i + '：')
                w = t[i]
                if q == w:
                    print('对喽！')
                    y += 1
                else:
                    print('错啦错啦！')
                    o += 1
                    m += 1
                    h[i] = w
            print('结束！')
            print('一共对',y,'道，错',o,'道')
        x = 0
        r = 0
        c = 0
        y = 0
        o = 0
        t = {}
    for l in range(g):
        print('\n第',l+1,'单元！\n')
        v = e[l]
        q(v)
    if m != 0:
        html = open('cuowu.txt','r')
        php = html.read()
        html.close()
        go = open('cuowu.txt','a')
        print('\n错题答案：共',m,'个二错单词\n')
        for i in h:
            d = h[i]
            print(i , d)
            if i not in php or d not in php:
                go.write("'")
                go.write(i)
                go.write("'")
                go.write(':')
                go.write("'")
                go.write(d)
                go.write("'")
                go.write(',\n')
        go.close()
    time.sleep(10)